<?php
/**
 * Phrappe_ConfigLoader_Abstract
 *
 * @copyright   Copyright (c) 2006, John D Wells Jr
 * @author      John D Wells Jr <mailto:wellsdjohn@gmail.com>
 * @category    Phrappe
 * @package     Phrappe_ConfigLoader
 */

/**
 * Phrappe_ConfigLoader_Abstract
 * 
 * @copyright   Copyright (c) 2006 John D Wells Jr
 * @author      John D Wells Jr <mailto:wellsdjohn@gmail.com>
 * @category    Phrappe
 * @package     Phrappe_ConfigLoader
 */
abstract class Phrappe_ConfigLoader_Abstract
{
    /**
     * Instance of Zend_Config
     * @var Zend_Config
     */
    protected $_zendConfig = null;

    /**
     * Instance of loaded object created from provided Zend_Config object.
     * @var Mixed
     */
    protected $_loaded = null;

    /**
     * Convenience feature, calls $this->load()->getLoaded()
     *
     * @param   Zend_Config $zendConfig
     * @return  mixed
     */
    public function run(Zend_Config $zendConfig)
    {
        return $this->load($zendConfig)->getLoaded();
    }

    /**
     * @return Zend_Controller_RewriteRouter
     */
    public function getLoaded()
    {
        return $this->_loaded;
    }

    /**
     * Performs the loading of whatever particular object is desired.
     *
     * @param   Zend_Config $zendConfig
     * @return  Phrappe_ConfigLoader_Abstract
     */
    abstract function load(Zend_Config $zendConfig);
}
